package com.wgchao.identityrightsmanagement.domain.organization.model;

import com.wgchao.identityrightsmanagement.domain.ValueObject;
import com.wgchao.identityrightsmanagement.infrastructure.exception.ParamNotLegalException;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.StringUtils;

/**
 * @ClassName: 地址
 * @author: wgchao
 * @createTime: 2020/6/6 7:56 AM
 * @Description: TODO
 */
@Getter
public class Address extends ValueObject {

    private String province;

    private String city;

    private String county;

    private String xxaddress;

    public Address(String province, String city, String county, String xxaddress) {
        if(StringUtils.isEmpty(province) || StringUtils.isEmpty(city) || StringUtils.isEmpty(county)){
            throw new ParamNotLegalException("地址不合法");
        }
        this.province = province;
        this.city = city;
        this.county = county;
        this.xxaddress = xxaddress;
    }
}